package com.hsxc.cdz.monitor.bean.pile.v1_21;

import com.hsxc.cdz.base.util.BytesUtil;

//遥测数据
public class TelemetryPileMsg extends PileMessage {

	/************************************************/
	//对象私有属性
	private int voltage;   //充电电压
    private int current;   //充电电流
    private int hours;     //充电小时
    private int minutes;   //充电分钟
    private int power;     //充电功率
    
    public static final int length = 15;
    /************************************************/
    //get() and set()
	public int getVoltage() {
		return voltage;
	}
	public void setVoltage(int voltage) {
		this.voltage = voltage;
	}
	public int getCurrent() {
		return current;
	}
	public void setCurrent(int current) {
		this.current = current;
	}
	public int getHours() {
		return hours;
	}
	public void setHours(int hours) {
		this.hours = hours;
	}
	public int getMinutes() {
		return minutes;
	}
	public void setMinutes(int minutes) {
		this.minutes = minutes;
	}
	public int getPower() {
		return power;
	}
	public void setPower(int power) {
		this.power = power;
	}
	
	/***********************************************/
	//重写父类方法
	@Override
	public void getContentFromByte(byte[] data) {
		byte[] temp;
		temp = BytesUtil.getByte(0, 3, data);
		this.setVoltage(BytesUtil.bytesToIntDesc(temp));
		
		temp = BytesUtil.getByte(3, 3, data);
		this.setCurrent(BytesUtil.bytesToIntDesc(temp));
	    
		temp = BytesUtil.getByte(6, 3, data);
		this.setHours(BytesUtil.bytesToIntDesc(temp));
	    
		temp = BytesUtil.getByte(9, 3, data);
		this.setMinutes(BytesUtil.bytesToIntDesc(temp));
		
		temp = BytesUtil.getByte(12, 3, data);
		this.setPower(BytesUtil.bytesToIntDesc(temp));
	}

}
